home *** CD-ROM | disk | FTP | other *** search
- ; The NCSA Switcher background processor
-
- blanks off
- case on
-
- Snastyhack PROC EXPORT
-
- ;
- ;
- ; PUBLIC _BKGRtask,_initBKGR
- EXPORT initBKGR, BKGRtask
- initBKGR
- LEA A5ptr,A0
- MOVE.L A5,D0
- MOVE.L D0,0(A0)
-
- LEA JumpTo,A0
- MOVE.L 4(SP),D0
- MOVE.L D0,0(A0)
- RTS
-
-
- BKGRtask
- MOVEA.L #$282,A0 ; Get the Switcher pointer
- MOVEA.L (A0),A0 ; Dereference once
- MOVE.L 36(A0),d0 ; Move the current Task into d0
- MOVE.L (a1),a1 ; This looks much better!
- CMPA.L d0,a1 ; is this my task?
- BNE.s BKGR1 ; if not then do our job.
- RTS ; otherwise go back to executing
- BKGR1:
- LEA A5save,A0 ; Prepare to save current A5
- MOVE.L A5,d0 ; Move to valid spot
- MOVE.L D0,(a0) ; store it
-
- LEA A5ptr,A0 ; Ready to get ours?
- MOVEA.L (a0),A5 ; Load 'er up!
-
- CLR.W -(a7) ; Clear stack
- LEA JumpTo,A0 ; Where do we go?
- MOVEA.L (a0),a0 ; Lets go there!
- JSR (a0) ; Go to the JumpTo Address
- ; Call netsleep(0)
-
- ADDQ.L #2,a7 ; Fix the stack.
-
- LEA A5save,A0 ; Prepare to give control back
- MOVEA.L (a0),a5 ; Load 'er up!
- RTS
-
- A5ptr DC.L 0
- A5save DC.L 0
- JumpTo DC.L 0
- ENDPROC
-
- END
-